home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / f2c_5_92 Folder / f2c_5_92 / ThinkXtra.c < prev   
Encoding:
Text File  |  1992-05-26  |  815 b   |  29 lines  |  [TEXT/KAHL]

  1. /* Extra Routines required by THINK_C to make life easy Basil P. Duval 26 May 1992 */
  2.  
  3. void    SetFType(fil,type,creat)
  4.     char *fil;
  5.     unsigned long type,creat;
  6. /*
  7.  * THINKC's stdio routines have the horrible habit of
  8.  * making any file you open look like generic files.
  9.  * This code tells the OS that it's a text file.
  10.  * add line
  11.  * extern    void SetFType(char *fil,unsigned long type,unsigned long creat);
  12.  */
  13.  {
  14.       fileParam    pb;
  15.     OSErr error=FALSE;
  16.  
  17.       CtoPstr(fil);
  18.         pb.ioNamePtr = (StringPtr)fil;
  19.         pb.ioVRefNum = 0;
  20.         pb.ioFVersNum = 0;
  21.         pb.ioFDirIndex = 0;
  22.         error = PBGetFInfo(&pb,0);
  23.         if (error == noErr) {
  24.             pb.ioFlFndrInfo.fdCreator = creat;
  25.             pb.ioFlFndrInfo.fdType = type;
  26.             error = PBSetFInfo(&pb, 0);
  27.         }
  28.         PtoCstr(fil);
  29. }